Skip to content

Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Actions#585

Draft
FionaLMcLaren wants to merge 23 commits intomainfrom
beacons-regenerate
Draft

Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Actions#585
FionaLMcLaren wants to merge 23 commits intomainfrom
beacons-regenerate

Conversation

@FionaLMcLaren
Copy link

@FionaLMcLaren FionaLMcLaren commented Feb 4, 2026

What Issue Does This PR Cover, If Any?

Resolves #572

What Changed? And Why Did It Change?

This PR adds the actions to revoke and regenerate tokens. It refactors the previous
"regenerate" code in the controller to be in a model. These actions are accessible to an admin user on their Admin Dashboard, when viewing a Beacon. This PR also does some cleanup on the views here, e.g.: removing the flashes for :api_key, as the information is already included in the success flash

How Has This Been Tested?

RSpec

Please Provide Screenshots

Beacon Configuration Admin View - Index Beacon Configuration Admin View - Index Beacon Configuration Admin View - Show Beacon Configuration Admin View - Show Beacon Configuration Admin View - Edit Beacon Configuration Admin View - Edit Beacon Configuration Admin View - Show, after regenerating token Beacon Configuration Admin View - Show, after regenerating token Beacon Configuration Admin View - Show, after revoking token Beacon Configuration Admin View - Show, after revoking token

seanmarcia and others added 8 commits February 3, 2026 12:08
…-api-keys

- Removed old beacon migration that conflicted with device migrations
- Updated BeaconsController to use Beacons::Creator service for API key generation
- Changed beacon relationships from direct provider/tags to many-to-many beacon_providers and beacon_topics
- Updated forms to use provider_ids and topic_ids multi-selects instead of single provider_id and tag_ids
- Updated show page to display API key (when just created) instead of token
- Updated index page to show region, language, provider count, and topic count
- Removed beacon_tag model and references as we now use beacon_topics
- Changed status from online/offline to active/revoked based on revoked_at timestamp
Topics use 'title' column, not 'name'. Updated controller and views to use Topic.active.order(:title)
- Update API key display messaging for admin context
- Add regenerate_key action in BeaconsController using KeyRegenerator service
- Add 'Regenerate API Key' button on show page with confirmation dialog
- Full API key still shown only after creation/regeneration via flash
- Clearer messaging that full key is displayed immediately after provisioning
- Added document_count method to Beacon model to count available topics
- Added file_count method to count actual attached document files
- Updated show page with 4 stat cards: Status, Available Topics, Document Files, and Configured Filters
- Logic respects beacon's language, providers (or region if no providers), and topic filters
Resolves #572

Adds actions to revoke and regenerate tokens. Refactors the previous
"regenerate" code in the controller to be in a model

TODO:
- Controller specs for beacons controller
- Route for revoking a Token
@FionaLMcLaren FionaLMcLaren changed the title Regenerate and Revoke Tokens on Beacon Configuration Admin View Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Options Feb 4, 2026
@FionaLMcLaren FionaLMcLaren changed the title Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Options Beacon Configuration Admin View, with CRUD and Regenerate and Revoke Tokens Actions Feb 4, 2026
dependabot bot and others added 10 commits February 4, 2026 12:19
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add libffi-dev package to Dockerfile.dev for Alpine Linux to support ffi gem (dependency).
Allows Bundler to resolve dependencies for Darwin
25.
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Marcia <seanmarcia@github.com>
@devjona
Copy link
Collaborator

devjona commented Feb 4, 2026

Hey @FionaLMcLaren for a ticket with so many visual elements, it's really helpful to put some screenshots in the PR description, particularly for:

  • Creating a token
  • Regen
  • Revoke

Thanks! Solid work!

Copy link
Collaborator

@devjona devjona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work! I left a few comments.

Copy link
Collaborator

@dmitrytrager dmitrytrager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have some comments, mostly about code validation and data integrity

@FionaLMcLaren FionaLMcLaren force-pushed the beacons-regenerate branch 2 times, most recently from 9931cda to a628a77 Compare February 4, 2026 15:05
put :provider, on: :collection
end

scope module: :beacons do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using

resources :beacons, except: :destroy, module: :beacons do
...
end

Without "scope" it should not change your routing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin Dashboard - Beacon Configuration

6 participants